package com.ruoyi.mall.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.mall.api.domian.Product;
import com.ruoyi.mall.api.domian.RecommendProductsVO;
import com.ruoyi.mall.api.factory.RemoteMallFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

@FeignClient(contextId = "remoteMallService", value = ServiceNameConstants.MALL_SERVICE, fallbackFactory = RemoteMallFallbackFactory.class)
public interface RemoteMallService {
    @PostMapping("/product/getRecommendProducts")
    R<List<Product>> getRecommendProducts(@RequestBody RecommendProductsVO<?> vo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
